﻿Imports Microsoft.VisualBasic

Partial Public Class bdSeguridadDataContext
    Inherits System.Data.Linq.DataContext
    Dim writer As New System.IO.StringWriter()
    Public Sub registrarLog(ByVal usuario As String, ByVal idsubmodulo As Integer, ByVal pagina As String)
        Dim lg As String
        MyBase.Log = writer
        lg = writer.ToString()
        'escribir el log
        Dim a As New web_Auditoria()
        Dim u As New Web_Usuario()
        Using h As New Helper
            h.InsertarAuditoria(usuario, idsubmodulo, pagina, lg)
        End Using
    End Sub
   
    Private Sub OnCreated()
        MyBase.Log = writer
    End Sub

End Class

Partial Public Class BdHogaresDataContext
    Inherits System.Data.Linq.DataContext
    Dim writer As New System.IO.StringWriter()
    Public Sub registrarLog(ByVal usuario As String, ByVal idsubmodulo As Integer, ByVal pagina As String)
        Dim lg As String
        MyBase.Log = writer
        lg = writer.ToString()
        'escribir el log
        Dim a As New web_Auditoria()
        Dim u As New Web_Usuario()
        Using h As New Helper
            h.InsertarAuditoria(usuario, idsubmodulo, pagina, lg)
        End Using
    End Sub

    Public Sub registrarLogError(ByVal usuario As String, ByVal idsubmodulo As Integer, ByVal pagina As String, ByVal erro As String)
        'escribir el log
        Dim a As New web_Auditoria()
        Dim u As New Web_Usuario()
        Using h As New Helper
            h.InsertarError(usuario, idsubmodulo, pagina, erro)
        End Using
    End Sub

    Private Sub OnCreated()
        MyBase.Log = writer
    End Sub
End Class